#ifndef STX_ALGORITHM_COPY_N_HPP
#define STX_ALGORITHM_COPY_N_HPP

#include <stx/algorithm/common.hpp>

namespace stx {

template <class InputIterator, class Size, class OutputIterator>
inline OutputIterator
copy_n(InputIterator first, Size count, OutputIterator result)
{
    if (count > 0) {
        *result++ = *first;
        for (Size i = 1; i < count; ++i) {
            *result++ = *++first;
        }
    }
    return result;
}

} // namespace stx

#endif // STX_ALGORITHM_COPY_N_HPP
